<?php

class Application_Form_AnggotaTeamProject extends Zend_Form
{
    private $_nik;
    
    public function getNik()
    {
        $this->_nik = new Application_Model_Pegawai();
        $result = $this->_nik->getAllNik();
        $i=array();
        
        foreach($result as $result)
        {
            $i[] = $result['nik'];
        } 
        
        return $i;
    }
    
    public function init()
    {
        $id_pegawai = new Zend_Form_Element_Hidden('id_pegawai');
        
        $nik = new ZendX_JQuery_Form_Element_AutoComplete('nik');
        $nik->setLabel('NIK')->setJQueryParams(array('source' => $this->getNik()));
        
        $nama = new Zend_Form_Element_Text('nama_pegawai');
        $nama->setLabel('Employee Name')->setAttrib("disabled",true);
        
        $submit = new Zend_Form_Element_Submit('submitAnggota');
        $submit->setLabel('Add Member');
        
        $this->addElements(array($nik, $nama, $submit, $id_pegawai));
    }


}

